package com.hqd.ch03.v51.context.event;

import com.hqd.ch03.v51.context.ApplicationEvent;
import com.hqd.ch03.v51.core.ResolvableType;

public interface GenericApplicationListener extends SmartApplicationListener {

    /**
     * Overrides {@link SmartApplicationListener#supportsEventType(Class)} with
     * delegation to {@link #supportsEventType(ResolvableType)}.
     */
    @Override
    default boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
        return supportsEventType(ResolvableType.forClass(eventType));
    }

    /**
     * Determine whether this listener actually supports the given event type.
     *
     * @param eventType the event type (never {@code null})
     */
    boolean supportsEventType(ResolvableType eventType);

}
